
######################################################
#
# boot cmd:
#   docker run -it --rm --privileged image_name:tag init
#   docker exec -it container_name bash
#   vncserver :81
#   DISPLAY=:81 xfce-session
#   
#   DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/1000/bus
#   -v /run/user/1000/bus:/run/user/1000/bus
#   -v /tmp/.X11-unix/X0:/tmp/.X11-unix/X0
# 
######################################################

# base image

FROM opensuse:tumbleweed
# FROM suse-xfce:tumbleweed

MAINTAINER ystlong@163.com

# RUN find /etc/zypp/repos.d -type f -exec sed -i 's|download.opensuse.org/tumbleweed|mirrors.ustc.edu.cn/opensuse/tumbleweed|g' {} \;
RUN zypper in -y glibc-locale glibc-i18ndata
RUN zypper in -y google*fonts wqy*fonts xorg-x11-fonts
RUN zypper in -y lxterminal xterm vi
RUN zypper in -y p7zip unzip
RUN zypper in -y wget curl which command-not-found
RUN zypper in -y iproute2 net-tools-deprecated

# RUN zypper in -y xorg-x11-fonts
# RUN zypper in -y -t pattern xfce
# RUN zypper in -y xfce4-terminal
# RUN zypper in -y wqy*fonts
# RUN zypper in -y fcitx fcitx-googlepinyin
# gnome-terminal
# mate-terminal
# echo 12345678123456781234567812345678 > /etc/machine-id
# RUN zypper in -y wine
# RUN zypper in -y tigervnc-x11vnc tigervnc
# RUN zypper in -y 
RUN useradd --create-home --no-log-init --shell /bin/bash long
RUN echo 'root:123456' |chpasswd
RUN echo 'export LANG=en_US.UTF-8' > /home/long/.bashrc

# 输入法配置
ADD http://ys-c.ys168.com/244626543/hjf5xVk4K465F3K6KM6/yong-lin-2.5.0-0.7z /tmp/yong-lin-2.5.0-0.7z
RUN mkdir /opt && cd /opt && 7zr x /tmp/yong-lin-2.5.0-0.7z
RUN /opt/yong/yong-tool.sh --install64


USER long
WORKDIR /home/long

# WORKDIR /root

# CMD init &; sleep 10; vncserver :1; DISPLAY=:1 xfce4-session


# RUN useradd --create-home --no-log-init --shell /bin/bash mynewuser
# RUN adduser mynewuser sudo
# RUN echo 'mynewuser:mynewpassword' | chpasswd
# USER mynewuser
# WORKDIR /home/mynewuser
